Time from now · Day.js 您所在的位置:网站首页 30 days ago Time from now · Day.js

Time from now · Day.js

2024-01-22 04:13| 来源: 网络整理| 查看: 265

Returns the string of relative time from now.

This requires the RelativeTime plugin to work dayjs.extend(relativeTime) dayjs('1999-01-01').fromNow() // 22 years ago

If you pass true, you can get the value without the suffix.

dayjs.extend(relativeTime) dayjs('1999-01-01').fromNow(true) // 22 years List of breakdown range

The base strings are localized by the current locale and can be customized. Time is rounded to the nearest second.

RangeKeySample Output 0 to 44 secondssa few seconds ago 45 to 89 secondsma minute ago 90 seconds to 44 minutesmm2 minutes ago ... 44 minutes ago 45 to 89 minuteshan hour ago 90 minutes to 21 hourshh2 hours ago ... 21 hours ago 22 to 35 hoursda day ago 36 hours to 25 daysdd2 days ago ... 25 days ago 26 to 45 daysMa month ago 46 days to 10 monthsMM2 months ago ... 10 months ago 11 months to 17monthsya year ago 18 months+yy2 years ago ... 20 years ago


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

      专题文章
        CopyRight 2018-2019 实验室设备网 版权所有